import request from '@/utils/request';

/**
 * @param 待入库订单列表 
 * @returns 
 */
export const getPendingStorageListApi = (data: any) => {
    return request({
        url: '/system/auxiliaryPurchaseOrder/pendingStorage',
        method: 'post',
        data: data
    });
};

/**
 * @package 删除入库订单
 */

export const deleteInboundOrdersApi = (ids: any) => {
    return request({
        url: `/system/auxiliaryPurchaseOrder/${ids}`,
        method: 'delete',
    });
};

/**
 * @package 入库订单详情
 */

export const getInboundOrdersDetailsApi = (id: any) => {
    return request({
        url: `/system/auxiliaryPurchaseOrder/getPurchaseInDetail`,
        method: 'get',
        params: { id: id }
    });
};

/**
 * @package 新增采购入库记录
 */

export const addInboundOrdersApi = (data: any) => {
    return request({
        url: '/system/purchaseInRecord',
        method: 'post',
        data: data
    });
};

/**
 * @package 待入库订单申请对账
 */

export const applyReconciliationApi = (data: any) => {
    return request({
        url: '/system/auxiliaryPurchaseOrder/applyReconciliation',
        method: 'put',
        data: data
    });
};

/**
 * @package 待入库订单撤销对账
 */

export const cancelReconciliationApi = (data: any) => {
    return request({
        url: '/system/auxiliaryPurchaseOrder/revokeReconciliation',
        method: 'put',
        params: data
    });
};

/**
 * @package 删除待入库单
 */

export const deletePurchaseRequestFormApi = (ids: any) => {
    return request({
        url: `/system/auxiliaryPurchaseOrder/${ids}`,
        method: 'delete',
    });
};

/**
 * @package 更新发货标识
 */

export const updateDeliveryFlagApi = (data: any) => {
    return request({
        url: '/system/auxiliaryPurchaseOrder/updateDeliveryFlag',
        method: 'put',
        params: data
    });
};

/**
 * @package 采购抽检页面详情or查看验收报告
 */

export const getPurchaseDetailsApi = (id: any) => {
    return request({
        url: `/system/auxiliaryPurchaseOrder/purchaseCheckDetail`,
        method: 'get',
        params: {id}
    });
};

/**
 * @package 新增采购验收
 */

export const addPurchaseAcceptanceApi = (data: any) => {
    return request({
        url: '/system/purchaseOrderCheck',
        method: 'post',
        data
    });
};